using System;
using System.Xml.Serialization;

namespace Xfinity.Weapons
{
    /// <summary>
    /// A description of a weapon.
    /// </summary>
    [Serializable]
    [XmlRoot(Namespace="Xfinity.Weapons")]
    public struct WeaponProperties
    {
        private float rateOfFire;
        bool rofSet;
        /// <summary>
        /// The rate of fire of the weapon.
        /// </summary>
        public float RateOfFire
        {
            get { return rateOfFire; }
            set { if (!rofSet) { rateOfFire = value; rofSet = true; } }
        }
        private string name;
        private bool nameBeenSet;
        /// <summary>
        /// The name of the weapon being described.
        /// </summary>
        public  string Name
        {
            get
            {
                if (name == null)
                    name = "";
                return name;
            }
            set { if (!nameBeenSet) { name = value; nameBeenSet = true; } }
        }

        
        private float barrelLength;
        bool blSet;
        /// <summary>
        /// The length of the barrel.
        /// </summary>
        public float BarrelLength
        {
            get { return barrelLength; }
            set { if (!blSet) { barrelLength = value; blSet = true; } }
        }

        private ProjectileProperties projectileProperties;
        bool ppSet;
        /// <summary>
        /// The description of the projectile the weapon fires.
        /// </summary>
        public ProjectileProperties ProjectileProperties
        {
            get { return projectileProperties; }
            set { if (!ppSet) { projectileProperties = value; ppSet = true; } }
        }


    }
}
